import Vue from "vue";
import Router from "vue-router";
import Login from '@/components/Login/index'
import Home from '@/view/home/index'
import Index from '@/view/index/index'
import BusinessData from '@/view/businessData/index'
import FinanceData from '@/view/financeData/index'
import Agreement from '@/view/agreement/index'
Vue.use(Router)
const routes = [
    {
        path: '/',
        redirect: '/home/index'
    },
    {
        path: '/login',
        component: Login
    },
    {
        path:'/agreement',
        component: Agreement
    },
    {
        path: '/home',
        component: Home,
        redirect: '/home/index',
        children: [
            {
                path: 'index',
                component: Index
            },
            {
                path: 'businessData',
                component: BusinessData
            },
            {
                path: 'financeData',
                component: FinanceData
            },
        ]
    },
]
const createRouter = () => new Router({
    scrollBehavior: () => ({y: 0}),
    mode: 'history',
    routes: routes
})
const router = createRouter()
export default router
